package com.lagou.sqlSession;

import java.util.List;

/**
 * @author YiYa
 * @since 2020-11-08 上午 10:25
 */
public interface SqlSession {

    // 查询所有
    public <E> List<E> selectList(String statementId, Object... params) throws Exception;

    // 按条件查询
    public <T> T selectOne(String statementId, Object... params) throws Exception;

    // 插入一条记录
    public Integer insertOne(String statementId, Object... params) throws Exception;

    // 插入批量记录
    // public Integer insertBatch(String statementId, Object... params);

    // 更新一条记录
    public Integer updateOne(String statementId, Object... params) throws Exception;

    // 更新批量记录
    // public Integer updateBatch(String statementId, Object... params);

    // 删除一条记录
    public Integer deleteOne(String statementId, Object... params) throws Exception;

    // 删除批量记录
    // public Integer deleteBatch(String statementId, Object... params);

    //为Dao接口生成代理实现类
    public <T> T getMapper(Class<?> mapperClass);
}
